package br.ufal.questione.domain;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "departamento", schema = "questione")
public class Departamento implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -7885470854362882126L;
	
	@Id
	@SequenceGenerator(name = "sequence-generator", sequenceName = "questione.departamento_ID_seq", allocationSize = 1)
	@GeneratedValue(generator = "sequence-generator", strategy = GenerationType.SEQUENCE)
	@Column(name = "id")
	private Long id;
	
	@Column(name = "nome")
	private String nome;

	@ManyToOne
	@JoinColumn(name = "id_centro")
	private Centro centro;
	
	@OneToMany(mappedBy = "departamento")
	private Set<Curso> cursos = new HashSet<Curso>();
	
	@Column(name = "sigla")
	private String sigla;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public void setCentro(Centro centro) {
		this.centro = centro;
	}

	public Centro getCentro() {
		return centro;
	}

	public void setSigla(String sigla) {
		this.sigla = sigla;
	}

	public String getSigla() {
		return sigla;
	}

	public void setCursos(Set<Curso> cursos) {
		this.cursos = cursos;
	}

	public Set<Curso> getCursos() {
		return cursos;
	}

}
